package evolutionaryballoons.behavior.genetic;

import java.awt.geom.Point2D;

import evolutionaryballoons.Balloon;
import evolutionaryballoons.Configuration;
import evolutionaryballoons.Points;

public class NodeInterface {
	protected DataProvider dataProvider;
	protected Balloon balloon;
	protected Points points;
	
	protected void perform(Actions action) {
		balloon.cost += action.cost();
		
		switch (action) {
			case ReleaseAir:
				// balloon.lift -= Configuration.sReleaseAirFactor;
				break;
			case TurnOffBurner:
				balloon.burnerOn = false;
				break;
			case TurnOnBurner:
				balloon.burnerOn = true;
				break;
			case TargetClosestPoint:
				Point2D p = points.getClosestPoint(balloon.x, balloon.y);
				
				if (p != null) {
					balloon.targetPoint = points.indexOf(p);
				}
				break;
		}
	}
}
